import { baseRequest } from '@/utils/request'
import { uploadBaseRequest } from '@/utils/uploadRequest'

const request = (url, ...arg) => baseRequest(url, ...arg)
const uploadRequest = (url, ...arg) => uploadBaseRequest(url, ...arg)

export default {
	// 客户信息
	modulePage(data) {
		return request('findfileInfo', data, 'post')
	},
	// 提交表单 edit为true时为编辑，默认为新增
	submitForm(data, edit = false) {
		return request(edit ? 'updatefileInfo' : '/api/insertuploadFileInfos', data)
	},
	// 删除模块
	moduleDelete(data) {
		return request('deleteOrderInfo', data)
	},
	// 获取模块详情
	moduleDetail(data) {
		return request('detail', data, 'get')
	},
	uploadFile(data) {
		return request('/static/upload', data, 'post')
	},
	downFile(data) {
		return request('download', data, 'get', { responseType: 'blob' })
	}
}
